require 'Json.rb'
require 'CloudWar_Parameter.rb'
require 'Queries.rb'


##########
$param = Parameter.new("USER1", 1, false)
$param.set_portfw

##########
jobtype			= "2chTripSearchEx"
#problem			= "NAIST+AAAAAAAA+ZZZZZZZZ"
problem			= "ABC+AAAAAAAA+ZZZZZZZZ"
redundancy		= 1
username		= "USER1"
optionstring	= "TESTTESTQUERY"
point			= 333

cw_query_runjob = Query_runjob.new
query_runjob = cw_query_runjob.create(jobtype, problem, redundancy, username, optionstring, point)
#query_runjob.assign_node(["node0209", "node0211", "node0213", "node0215", "node0217", "node0219"])
#query_runjob.assign_node(["node0002"])
query_runjob.assign_node(["node0208", "node0210", "node0212", "node0214", "node0216", "node0218"])
#query_runjob.assign_node(["node0011"])

#########
host = $param.host
port = $param.port
path = $param.path_runjob
data = query_runjob

printf("http://%s:%d/%s\n", host, port, path)
p data
puts "----------------"

response = Json::put_json(host, path, port, data)

p response
